#include<stdio.h>

void rotate(int* nums, int numSize, int k)
 {
	int* newArr = (int*)malloc(numSize * sizeof(int));
	for (int i = 0; i < numSize; ++i)
	 {
		 newArr[(i + k) % numSize] = nums[i];
		 }
	 for (int i = 0; i < numSize; ++i)
	 {
		 nums[i] = newArr[i];
		 }
	 free(newArr);
	 }

int main()
{
	int arr[7] = { 1,2,3,4,5,6,7};
	int k = 3;
	int numSize = sizeof(arr) / sizeof(arr[0]);
	rotate(arr, numSize, k);
	for (int i = 0; i < numSize; i++)
	{
		printf("%d", arr[i]);

	}
	return 0;

}